<?php

declare(strict_types=1);

namespace App\Job;

use App\Model\Normal;
use App\Model\Order;
use App\Services\Iot\IotService1 as IotService;
use Hyperf\AsyncQueue\Job;

class DeviceStop extends Job
{
    public string $iot_sn;
    public string $channel_number;
    /**
     * 任务执行失败后的重试次数，即最大执行次数为 $maxAttempts+1 次
     */
    protected int $maxAttempts = 1;


    public function __construct($iot_sn,$channel_number)
    {
        // 这里最好是普通数据，不要使用携带 IO 的对象，比如 PDO 对象
        $this->iot_sn = $iot_sn;
        $this->channel_number =$channel_number;
    }

    public function handle()
    {

        IotService::stop($this->iot_sn, $this->channel_number);
    }
}
